package stu.day19_day24.day20;

import java.util.Arrays;

public class LeetCode455 {

    public int findContentChildren(int[] g, int[] s) {

        Arrays.sort(g);
        Arrays.sort(s);

        int index = 0;
        int num = 0;
        for(int x:s){
            if(index >= g.length){
                break;
            }
            if(x>=g[index]){
                num += 1;
                index += 1;
            }
        }

        return num;

    }
}
